package model;

import model.pieces.Piece;

public class Cell
{
    private final File _file;
    private final int _rank;
    private Piece _piece;
    private ChessBoard _chessBoard;
    
    public void setPiece(Piece piece)
    {
        _piece = piece;
    }
    
    public Piece getPiece()
    {
        return _piece;
    }
    
    public ChessBoard getChessBoard()
    {
        return _chessBoard;
    }
    
    public Cell setChessBoard(ChessBoard chessBoard)
    {
        _chessBoard = chessBoard;
        return this;
    }
    
    public Cell(File file, int rank)
    {
        _file = file;
        _rank = rank;
        _piece = null;
    }
    
    public boolean isEmpty()
    {
        return getPiece() == null;
    }

    public int getRank()
    {
        return _rank;
    }

    public File getFile()
    {
        return _file;
    }
}
